import fs from "fs";
import path from "path";

function deleteMapFiles(dir) {
  fs.readdirSync(dir).forEach((file) => {
    const fullPath = path.join(dir, file);
    if (fs.lstatSync(fullPath).isDirectory()) {
      deleteMapFiles(fullPath);
    } else if (file.endsWith(".map")) {
      fs.unlinkSync(fullPath);
      console.log(`Deleted: ${fullPath}`);
    }
  });
}

deleteMapFiles("dist");
